package cn.demoncat.util.web.util;

import java.lang.reflect.Method;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;

import cn.demoncat.util.web.entity.AsyncExceptionLog;

/**
 * 异步异常处理器
 * 
 * @author 延晓磊
 *
 * @since 2019年10月21日
 */
public class AsyncExceptionHandler implements AsyncUncaughtExceptionHandler{

	private static final Logger LOG = LoggerFactory.getLogger(AsyncExceptionHandler.class);
	
	@Override
	public void handleUncaughtException(Throwable ex, Method method, Object... params) {
		LOG.error(AsyncExceptionLog.toString(method, params), ex);
	}

}
